package com.wang;

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.DispatcherServlet;

/**
 * @Classname SpringBootDemo01
 * @Description TODO
 * @Date 2024/5/8 12:11
 * @Created by pc
 */
@SpringBootApplication() // 表示当前的项目是一个SpringBoot应用
@RestController  // 该注解 相当于Controller+@ResponseBody
public class SpringBootDemo01 {
    // main方法运行后 springboot会自动运行内置的tomcat
    public static void main(String[] args) {
        // 启动springboot项目
        SpringApplication.run(SpringBootDemo01.class,args);
    }

    @RequestMapping("/index")
    public String index(){
        System.out.println("index---");
        return "index~~~~";
    }
}
